

//TODO a(45)
function a45(module, exports, __webpack_require__) {
    function AdMaterial(e, t, a, i, s, r, n, o, l, d, h, c, p, u, g, f) {
        this.h5ad = e, this.duration = parseInt(l) || 0, this.impression = r || [], this.clickUrl = a, this.tracking = i, this.event = s, this.oid = n, this.orderid = o, this.curIdx = c, f ? this.url = t : this.resolveAdParam(t), this.adType = d + "", this.aduid = h, this.lc = p, this.sub = u || "", this.ord = g, this.initEvent()
    }

    var lib = __webpack_require__(3), br = __webpack_require__(2), $js = __webpack_require__(6), isLeSportsM = !1, isLeSportsH = !1, adTools = {
        jsonpList: [],
        getJSON: function (e, t, a, i) {
            var s = this, r = lib.getJSON({
                url: e, maxCount: 1, success: function () {
                    t && t.apply(s, arguments), n(r)
                }, fail: function () {
                    a && a.apply(s, arguments), n(r)
                }, timeout: i ? i : 1e4
            }), n = function (e) {
                for (var t = 0; t < s.jsonpList.length; ++t)if (s.jsonpList[t] == e) {
                    delete s.jsonpList[t];
                    break
                }
            };
            this.jsonpList.push(r)
        },
        destoryJsonp: function () {
            for (var e = this.jsonpList, t = 0; t < e.length; ++t)try {
                e[t] && e[t].destroy()
            } catch (a) {
                adTools.debug(a)
            }
            this.jsonpList = []
        },
        param: function (e) {
            var t = new Array;
            if ("object" == typeof e)for (var a in e)if (e.hasOwnProperty(a)) {
                if ("-" === e[a])continue;
                t.push(encodeURIComponent(a) + "=" + encodeURIComponent(e[a]))
            }
            return t.join("&")
        },
        sendLogs: function (e, t, a) {
        },
        wsLog: function (e) {
        },
        debug: function (e, t, a) {
            if (a = a || " ", 1 == H5AD.config.DEBUG || adTools.getQuery("arkdebug"))if ("object" == typeof e) t && (console.log("%c" + t, "color:#f0d"), this.wsLog(t)), this.wsLog(e), console.log(e); else {
                if (void 0 == e)return void console.log("数据空" + a);
                this.wsLog(e), console.log(e + a)
            }
        },
        json: function (data) {
            try {
                return "string" == typeof data ? JSON && JSON.parse ? JSON.parse(data) : eval("(" + data + ")") : JSON.stringify(data)
            } catch (ex) {
                return "error"
            }
        },
        resoSid: function (e) {
            return e
        },
        getQuery: function (e, t) {
            var a = t || location.search;
            if (a.length > 0 && a.indexOf("?") != -1) {
                var i = new RegExp(e + "=([^&]*)", "i"), s = a.match(i);
                return s && s.length > 0 ? unescape(s[1]) : null
            }
            return null
        },
        easyClone: function (e, t) {
            for (var a in t)t.hasOwnProperty(a) && "object" != typeof t[a] && (e[a] = t[a])
        },
        arkMapper: function (e) {
            if ("string" == typeof e && (e = parseInt(e), isNaN(e)))return isLeSportsM ? 1128 : 132;
            if (this.isMStation && (br.iPhone || br.iPod)) {
                var t = H5AD.config.M_ARK_MAPPER[e];
                if (t)return t
            }
            return isLeSportsM || isLeSportsH ? H5AD.config.ARK_Mapper[e] || (isLeSportsM ? 1128 : 1129) : H5AD.config.ARK_Mapper[e] || (this.isMStation ? 132 : 147)
        },
        removeElem: function (e) {
            if (e)return e.remove ? e.remove() : e.parentNode && e.parentNode.removeChild && e.parentNode.removeChild(e)
        },
        el: function (e, t) {
            var a = t ? $js(e).find(t)[0] : $js(e)[0];
            return a || (a = {
                setAttribute: function () {
                }, style: {}, isnull: !0
            }), a
        },
        bind: function (e, t) {
            br.isPC ? e.on("click", t) : e.on("click", t)
        },
        existEl: function (e) {
            return "object" == typeof e ? !e.isnull && (!(e instanceof Array) || e.length > 0) : "string" == typeof e && arguments.callee(this.el(e))
        },
        getAslbUrl: function (e, t, a) {
            var i, s;
            if (t.result = t.result || [], e instanceof Array) {
                if (s = e.shift(), !s)return t(t.result);
                if (s.url && s.url.indexOf(H5AD.config.ASLB_DOMAIN) >= 0 ? i = br.iPhone || br.iPod || br.iPad ? s.url + "&tss=ios&format=1&jsonp=?" : s.url + "&format=1&jsonp=?" : (t.result.push(s), adTools.getAslbUrl(e, t, a)), void 0 === i)return;
                adTools.getJSON(i, function (i, r) {
                    0 == /mp4|m3u8/.test(i.location) ? (s.ryCount = $js.retryCount, s.costTime = r.responseTime, s.err = 474, a.sendEvent(H5AD.config.SEND_EVENT_TYPE.OnASLB, {
                            curAD: s,
                            curIndex: s.curIdx
                        }), H5AD.collectError("474,format error," + adTools.json(s), 3), adTools.getAslbUrl(e, t, a)) : (s.rUrl = s.url, s.url = i.location, s.ryCount = $js.retryCount, s.costTime = r.responseTime, t.result.push(s), a.sendEvent(H5AD.config.SEND_EVENT_TYPE.OnASLB, {
                            curAD: s,
                            curIndex: s.curIdx
                        }), adTools.getAslbUrl(e, t, a))
                }, function (i) {
                    s.ryCount = $js.retryCount, s.costTime = msg.responseTime, s.err = 473, t.result.push(s), a.sendEvent(H5AD.config.SEND_EVENT_TYPE.OnASLB, {
                        curAD: s,
                        curIndex: s.curIdx
                    }), H5AD.collectError("473,aslb error," + adTools.json(s), 3), adTools.getAslbUrl(e, t, a)
                })
            } else {
                if (i.indexOf(H5AD.config.ASLB_DOMAIN) < 0)return t([]);
                i = e + "&format=1&jsonp=?", adTools.getJSON(i, function (e) {
                    return t([e.location])
                }, function (e) {
                    return t([])
                })
            }
        },
        loadCss: function (e, t) {
            var a = document.head || document.getElementsByTagName("head")[0] || document.documentElement, i = document.createElement("style");
            i.setAttribute("type", "text/css"), i.id = "h5adstyle", i.innerHTML = e, a.appendChild(i)
        },
        detectUA: function () {
            var e = navigator.userAgent;
            this.easyClone(br, {
                LetvClient_iphone: /LetvClient_.+_iphone/.test(e),
                LetvClient_ipad: /LetvClient_.+_ipad/.test(e),
                LetvMobileClient_android: /LetvMobileClient_.+_android/.test(e)
            })
        },
        httpToHttps: function (e) {
            if (e)for (var t = 0; t < H5AD.config.httpsUrl.length; t++) {
                var a = H5AD.config.httpsUrl[t];
                H5AD.config[a] && (H5AD.config[a] = H5AD.config[a].replace("http:", "https:"), H5AD.config[a] = H5AD.config[a].replace("apple.www.letv.", "apple-www.le."))
            }
        },
        getDeviceSize: function () {
            var e = screen;
            return {x: e.width > e.height ? e.width : e.height, y: e.width > e.height ? e.height : e.width}
        }(),
        canBeClicked: function () {
            return !(br.iPhone || br.iPod || br.msie)
        }(),
        isUC: br.uc,
        isMStation: !1,
        iosNotPlayInline: !0
    }, H5AD = function (e, t) {
        this.fid = t || "h5ad_" + Math.floor(Math.random() * +new Date), this.ad = e, this.playAdTimer = [], this.dynamicVars = {
            retry: 0,
            adidQueue: [],
            isFirst: !0,
            hasPlayed: !1,
            pauseOnTime: 0
        }, this.staticVars = {
            countdownID: null,
            arkId: 132,
            countdownElem: null,
            pauseCis: 0,
            ptid: 4,
            cuid: 0
        }, this.putinVars = {}
    };
    H5AD.config = {
        AD_STYLE: {pre_roll: "2", standard: "3", pause: "6"},
        SEND_EVENT_TYPE: {
            OnStart: "AD_PLAY",
            OnComplate: "AD_ENDED",
            OnClick: "AD_CLICK",
            OnAcComplate: "AC_COMPLATE",
            OnError: "AD_ERROR",
            OnPause: "AD_PAUSE",
            OnASLB: "AD_ASLB",
            OnLoginAc: "loginCb",
            OnRefreshAd: "OnRefreshAd",
            OnTimeUpdate: "AD_TimeUpdate"
        },
        CALL_PLAYER_TYPE: {
            playAD: "playAD",
            stopAD: "stopAD",
            seek: "seek",
            pauseAD: "pauseAD",
            resumeAD: "resumeAD",
            getRealTime: "getCurrTime",
            getPlayerSize: "getVideoRect",
            doLogin: "login",
            pingback: "pingback",
            lanfit: "lanfit"
        },
        PROCESS_EVENT_TICKS: [{k: "firstQuartile", v: .25}, {k: "midpoint", v: .5}, {k: "thirdQuartile", v: .75}],
        crc_table: [61888, 62024, 21822, 44648, 51027, 25193, 39449, 32749, 45072, 19780, 27911, 40640, 22412, 47959, 2033, 15647, 26948, 7977, 333, 52810, 2229, 28457, 56115, 3222, 7819, 8261, 37040, 26479, 46017, 37654, 52255, 36436, 49642, 26018, 41611, 57969, 22529, 40087, 25454, 12785, 50531, 1739, 4421, 44187, 14573, 60124, 48843, 50551, 63571, 18928, 9702, 31935, 37924, 53689, 43138, 29106, 22299, 17913, 22765, 17733, 13233, 54102, 63095, 54790, 45315, 4283, 52320, 21487, 24719, 23499, 25688, 43296, 18522, 46226, 54051, 23750, 63855, 40050, 23830, 13909, 53473, 35269, 6541, 59749, 45495, 7225, 26512, 17657, 28777, 4159, 17208, 50565, 48334, 33575, 10897, 26141, 42425, 51911, 4632, 28267, 27030, 57778, 15356, 31158, 14774, 53522, 27342, 33231, 29241, 52365, 12102, 5400, 40637, 7989, 51774, 31639, 1064, 46043, 38691, 42315, 25171, 2606, 94, 25879, 50273, 48389, 61059, 63334, 38144, 34805, 17489, 9758, 21488, 31104, 40127, 47832, 19575, 8379, 62899, 64770, 6327, 15962, 35087, 34e3, 41978, 50244, 40758, 57390, 20080, 51537, 61759, 31722, 57084, 25726, 3693, 42772, 41971, 46086, 30626, 46885, 37383, 847, 38119, 23229, 59572, 58742, 40006, 20034, 62943, 57283, 50816, 54485, 36496, 28963, 5481, 23375, 51432, 3135, 18675, 20557, 968, 55963, 47914, 45119, 25284, 1646, 34994, 1493, 10573, 32670, 64131, 45013, 56896, 57534, 26361, 47505, 26941, 31536, 886, 43364, 32112, 18014, 13600, 60378, 12717, 60596, 9862, 56041, 44055, 39986, 37168, 28168, 55209, 30733, 5480, 6034, 17485, 56710, 63417, 33557, 9848, 39651, 64250, 14639, 63835, 38963, 7906, 39909, 7971, 10158, 40564, 25844, 3305, 50258, 28353, 42316, 44088, 44477, 1500, 42481, 45659, 44289, 10989, 54239, 19915, 42407, 19391, 1463, 50295, 60742, 8528, 50215, 445, 89, 39965, 42071],
        ARK_Mapper: {
            4: "140",
            5: "142",
            6: "141",
            20: "134",
            21: "133",
            22: "135",
            23: "144",
            24: "146",
            25: "143",
            26: "137",
            27: "139",
            28: "138",
            29: "136",
            88: "148",
            166: "148",
            90: "145",
            91: "147",
            100: "372",
            104: "147",
            335: "335",
            329: "329",
            292: "292",
            132: "132",
            131: "131",
            130: "130",
            129: "129",
            128: "128",
            127: "127",
            126: "126",
            125: "125",
            124: "124",
            123: "123",
            122: "122",
            121: "121",
            120: "120",
            118: "118",
            372: "372",
            419: "419",
            1038: "1038",
            1039: "1039",
            1040: "1040",
            1041: "1041",
            1042: "1042",
            1043: "1043",
            1044: "1044",
            1045: "1045",
            1046: "1046",
            1047: "1047",
            1048: "1048",
            1049: "1049",
            1050: "1050",
            1051: "1051",
            1052: "1052",
            1128: "1128",
            735: "1068",
            842: "1069",
            843: "1070",
            844: "1071",
            889: "1072",
            1119: "1073",
            845: "1074",
            846: "1075",
            847: "1076",
            1120: "1077",
            849: "1078",
            1121: "1079",
            1122: "1080",
            1123: "1081",
            838: "1082",
            1129: "1129",
            1180: "1180",
            1328: "1329",
            1329: "1329"
        },
        M_ARK_MAPPER: {
            335: "471",
            329: "472",
            292: "473",
            132: "474",
            131: "475",
            130: "476",
            129: "477",
            128: "478",
            127: "479",
            126: "480",
            125: "481",
            124: "482",
            123: "483",
            122: "484",
            121: "486",
            120: "487",
            118: "488",
            1038: "1053",
            1039: "1054",
            1040: "1055",
            1041: "1056",
            1042: "1057",
            1043: "1058",
            1044: "1059",
            1045: "1060",
            1046: "1061",
            1047: "1062",
            1048: "1063",
            1049: "1064",
            1050: "1065",
            1051: "1066",
            1052: "1067",
            1128: "1130",
            1180: "1181",
            1328: "1329",
            1329: "1329"
        },
        H5_ADPLAYER_VER: "aps_h5_2.1.30",
        COUNTDOWN_IMG_URL: "//i1.letvimg.com/img/201504/27/h5_10/h5_10/numbers.png",
        VDO_BG_URL: "//i2.letvimg.com/img/201504/27/h5_10/h5_10/bg.png",
        SKIPAD_IMG_URL: "//i2.letvimg.com/img/201504/27/h5_10/h5_10/skipad.png",
        SEEDETAIL_IMG_URL: "//i1.letvimg.com/img/201504/27/h5_10/h5_10/seedetail.png",
        ARK_DOMAIN: "ark.letv.com/t",
        ASLB_DOMAIN: "g3.letv",
        ARK_SHOW_URL: "http://ark.letv.com/s?res=jsonp",
        ARK_PREVIEW_URL: "http://ark.letv.com/p?res=jsonp",
        DC_AD_URL: "http://apple.www.letv.com/va/?",
        SKIP_AD_CLICK: "http://dc.letv.com/s/?k=sumtmp;H5PADQad",
        SKIP_AD_SUCC: "http://dc.letv.com/s/?k=sumtmp;H5PADQadfc",
        REQ_ARK_TIMEOUT: 15e3,
        DOWNLOAD_URL_TIMEOUT: 1e4,
        WS_URL: "ws://10.58.88.69:8080",
        CSS_TEMPLATE: ['.precdImg{float: left;width: 14px;height: 24px;overflow: hidden;}.vdo_time_info span{margin-top: 12px;float: left;}.hv_box_mb .precdImg ,.hv_box_live_mb .precdImg{float: left;width: 8px;height: 12px;background-size: 100%;overflow: hidden;}.vdo_post_time,.vdo_post_detail{position: absolute;right: 18px;height: 50px;line-height: 50px;text-align: center;z-index: 13;}.vdo_post_time a:hover,.vdo_post_time a:visited,.vdo_post_detail a:hover,.vdo_post_detail a:visited{color:#fff}.vdo_post_time a,.vdo_post_detail a{font-family: 12px/1.5 "微软雅黑",arial;color: #fff;font-size: 20px;}.vdo_post_detail a{margin-left: 60px;}.hv_box_mb .vdo_post_detail a,.hv_box_live_mb .vdo_post_detail a{margin-left: 35px;font-size: 10px;}.vdo_post_time{top: 14px;}.vdo_post_rlt{position: relative;width: 100%;height: 50px}.vdo_time_bg,.vdo_detail_bg{position: absolute;width: 100%;height: 50px;left: 0;top: 0;background-color: #000;opacity: 0.5;border-radius: 10px;}.vdo_time_info,.vdo_detail_info{position: relative}.vdo_time_info span{float: left;margin-left: 36px;}.vdo_time_info a{float: left;margin-left: 34px;margin-right: 41px;}.hv_box_mb .vdo_time_info a, .hv_box_live_mb .vdo_time_info a{margin-left: 10px;margin-right: 10px;font-size: 10px;}.vdo_post_detail{bottom: 14px}.vdo_post_detail a,.vdo_post_detail a:hover{display: block;margin-right: 24px;}.hv_box_mb .vdo_post_detail a,.hv_box_mb .vdo_post_detail a:hover,.hv_box_live_mb .vdo_post_detail a,.hv_box_live_mb .vdo_post_detail a:hover{padding-top:1px;margin-left: 35px;margin-right: 12px;}.vdo_post_detail i{background: url(//i1.letvimg.com/img/201504/29/bg.png) no-repeat;width: 14px;height: 24px;float: right;margin-top: 14px;margin-left: 43px;}.hv_box_mb .vdo_post_detail i,.hv_box_live_mb .vdo_post_detail i{display: block;width: 7px;height: 10px;background: url(//i1.letvimg.com/img/201504/29/bg.png) no-repeat;background-size: 100%;margin-top: 6px;margin-left: 22px;}.hv_box_mb .vdo_post_time,.hv_box_live_mb .vdo_post_time{right: 9px;top: 7px;}.hv_box_mb .vdo_post_detail,.hv_box_live_mb .vdo_post_detail{bottom: 7px;right: 9px;}.hv_box_mb .vdo_post_time,.hv_box_mb .vdo_post_detail,.hv_box_live_mb .vdo_post_time,.hv_box_live_mb .vdo_post_detail{height: 26px;line-height: 26px;}.hv_box_mb .vdo_post_rlt,.hv_box_mb .vdo_time_bg,.hv_box_mb .vdo_detail_bg,.hv_box_mb .vdo_post_detail a,.hv_box_mb .vdo_post_detail,.hv_box_live_mb .vdo_post_rlt,.hv_box_live_mb .vdo_time_bg,.hv_box_live_mb .vdo_detail_bg,.hv_box_live_mb .vdo_post_detail a,.hv_box_live_mb .vdo_post_detail a:hover{height: 25px;border-radius: 5px;}.hv_box_mb .vdo_detail_info{height: 26px;width: 100%;}.hv_box_mb .vdo_time_info span,.hv_box_live_mb .vdo_time_info span{margin-left: 20px;margin-top: 7px;float: left}.aps_mask_cont{position: absolute;width: 100%;height: 100%;top: 0px;left: 0px;z-index: 12;}.aps_pop_poster{width: 100%;height: 100%;position: absolute;top: 0;left: 0;z-index: 999;}.vdo_send_log{position: absolute;top: 80px;height: 100px;right: 10px;font-size: 30px;z-index: 30}.hv_pop_poster{position: absolute;top: 50%;left: 50%;margin: -112px 0 0 -182px;width: 365px;height: 175px;overflow: hidden;background-color: #f1f1f1;}.hv_pop_poster p{text-align: center;margin-bottom: 12px}.hv_pop_poster p.hv_p1{padding-top: 48px}.hv_pop_poster a{display: inline-block;height: 40px;width: 224px;line-height: 40px;background-color: #f7f7f7;font-size: 15px;color: #7e7e7e;border: 1px solid #d1d1d1}.hv_pop_poster a.blu{background-color: #00a0e9;color: #ffffff;border: 1px solid #00a0e9}.hv_pop_poster a.close{width: 20px;height: 20px;display: block;position: absolute;top: 10px;right: 10px;border: none;background: none}.hv_pop_poster a.close i{display: block;width: 18px;height: 2px;position: absolute;top: 6px;left: 0;background: #737373;transform: rotate(-45deg);-ms-transform: rotate(-45deg);-moz-transform: rotate(-45deg);-webkit-transform: rotate(-45deg);-o-transform: rotate(-45deg)}.hv_pop_poster a.close i.i_1{transform: rotate(45deg);-ms-transform: rotate(45deg);-moz-transform: rotate(45deg);-webkit-transform: rotate(45deg);-o-transform: rotate(45deg)}.hv_pop_poster .hv_org{color: #fd6c01}'].join(""),
        DEBUG: !1,
        ArkDebug: !1,
        retryCount: 1,
        isPauseState: 0,
        securityKeys: ["rt", "oid", "im", "t", "data"],
        isHttps: 0,
        httpsUrl: ["ARK_SHOW_URL", "ARK_PREVIEW_URL", "DC_AD_URL", "SKIP_AD_CLICK", "SKIP_AD_SUCC"]
    }, H5AD.prototype = {
        requestLock: !1, lastPlayTime: 0, adQueue: [], loadCss: function () {
            adTools.loadCss(H5AD.config.CSS_TEMPLATE)
        }, prepareImages: function (e, t) {
            var a = new Image;
            a.src = e, "undefined" != typeof t && (a.complete ? t(a.width, a.height) : a.onload = function () {
                    t(a.width, a.height), a.onload = null
                })
        }, destory: function (e) {
            if (e = e || this.curAd)try {
                e.closeCountDown(), this.callback2Player = null, this.putinVars = {}, this.dynamicVars = {
                    retry: 0,
                    adidQueue: [],
                    isFirst: !0,
                    hasPlayed: !1
                }, this.lastPlayTime = 0, this.adQueue = [], this.playingMonitorCount = 0, this.playAdTimer && this.playAdTimer.length > 0 && clearTimeout(this.playAdTimer[e.curIndex]), clearTimeout(this.downMaterialTimer), clearTimeout(this.arkTimer), clearTimeout(this.playingMonitor), clearInterval(e.processTimer), clearInterval(e.countdownTimer), clearInterval(e.monitorTimer);
                var t = adTools.el("#a_see_detail" + this.fid);
                adTools.existEl(t) && adTools.removeElem(t), this.adEventDispatcher = null
            } catch (a) {
            }
        }, openApp: function (e, t) {
            var a = "letvclient://msiteAction?actionType=0&pid=" + encodeURIComponent(e) + "&vid=" + encodeURIComponent(t) + "&from=mletv";
            setTimeout(function () {
                (new Date).valueOf();
                if (br.Android) {
                    var e = document.createElement("iframe");
                    e.style.cssText = "width:0px;height:0px;position:fixed;top:0;left:0;", e.src = a, document.body.appendChild(e)
                } else location.href = a;
                setTimeout(function () {
                }, 1500)
            }, 100)
        }, initAD: function (e, t) {
            var a = this;
            if (H5AD.config.isHttps = parseInt(e.isHttps), adTools.httpToHttps(H5AD.config.isHttps), "0p" == e.p2 && (isLeSportsM = !0, isLeSportsH = !1), "0q" == e.p2 && (isLeSportsH = !0, isLeSportsM = !1), e.isMStation = e.tplType && /^min|IPhone|^simple/.test(e.tplType), "vip" == e.tryLookType && parseInt(e.tryLookTime) > 0 && (e.istrylook = 1), adTools.iosNotPlayInline = !!e.Notplayinline, e.vipbrand = 0, e.vipInfo)for (var i in e.vipInfo) {
                var s = e.vipInfo[i];
                s && (301 == s.typeGroup && 1 == s.isvip ? (e.isvip = 1, 0 == e.vipbrand && s.vipbrand && (e.vipbrand = s.vipbrand)) : 302 == s.typeGroup && 1 == s.isvip && (e.isSportvip = 1))
            }
            a.is_need_video_info = "", a.curAd && a.destory(a.curAd), a.staticVars.pauseCis && (a.staticVars.pauseCis = 0), a.loadCss(), a.prepareImages(H5AD.config.COUNTDOWN_IMG_URL), adTools.detectUA(), adTools.debug(e, "传过来的值：");
            var r, n = H5AD.config, o = n.SEND_EVENT_TYPE, l = n.CALL_PLAYER_TYPE;
            if (e && t) {
                if (a.callback2Player = function () {
                        try {
                            return t.apply(a.ad, arguments)
                        } catch (e) {
                            H5AD.collectError("497&err=" + (e || {}).stack, 3), adTools.debug(e);
                            try {
                                t(l.stopAD, {reason: 0, margs: arguments})
                            } catch (i) {
                            }
                        }
                    }, a.putinVars = e, this.requestLock === !0)return;
                this.requestLock = !0
            } else e = a.putinVars, t = a.callback2Player;
            if (a.putinVars.ark == -1)return a.sendEvent(o.OnAcComplate, {
                atype: "2",
                curAD: {},
                curIndex: -1,
                ia: 6
            }), void a.callback2Player.call(a, l.stopAD, {reason: 14});
            if (br.isLetv && !br.LetvClient_iphone && !br.LetvClient_ipad && !br.LetvMobileClient_android || br.weixin || br.weibo || /News/.test(navigator.userAgent))return a.sendEvent(o.OnAcComplate, {
                atype: "2",
                curAD: {},
                curIndex: -1,
                ia: 10
            }), a.callback2Player.call(a, l.stopAD, {reason: 1}), void adTools.debug(navigator.userAgent);
            if ("30" == a.putinVars.cid)return a.sendEvent(o.OnAcComplate, {
                atype: "2",
                curAD: {},
                curIndex: -1,
                ia: 105
            }), void a.callback2Player.call(a, l.stopAD, {
                reason: 13
            });
            if (a.startTime = lib.now(), parseInt(e.isvip) && !e.vipbrand)return a.callback2Player.call(a, l.stopAD, {reason: 11}), a.sendEvent(o.OnAcComplate, {
                atype: "2",
                curAD: {},
                curIndex: -1,
                ia: e.isvip
            }), e.isMStation || a.sendEvent(o.OnAcComplate, {
                atype: "3",
                curAD: {},
                curIndex: -1,
                ia: e.isvip
            }), void a.tips("tips", "您正享受乐视会员去广告服务");
            if (parseInt(e.isSportvip) && ("sports" == e.liveType || 4 == parseInt(e.cid)))return a.callback2Player.call(a, l.stopAD, {reason: 15}), a.sendEvent(o.OnAcComplate, {
                atype: "2",
                curAD: {},
                curIndex: -1,
                ia: 5
            }), e.isMStation || a.sendEvent(o.OnAcComplate, {
                atype: "3",
                curAD: {},
                curIndex: -1,
                ia: 5
            }), void a.tips("tips", "您正享受乐视体育会员去广告服务");
            if (e.ispay && !e.vipbrand && !e.istrylook)return _ia = 4, a.callback2Player.call(a, l.stopAD, {reason: 2}), a.sendEvent(o.OnAcComplate, {
                atype: "2",
                curAD: {},
                curIndex: -1,
                ia: _ia
            }), e.isMStation || a.sendEvent(o.OnAcComplate, {
                atype: "3",
                curAD: {},
                curIndex: -1,
                ia: _ia
            }), void a.tips("tips", "试看服务");
            if ("baidullq" == adTools.getQuery("ref") && navigator.userAgent.indexOf("baidubrowser") >= 0)return a.callback2Player.call(a, l.stopAD, {reason: 3}), a.sendEvent(o.OnAcComplate, {
                atype: "2",
                curAD: {},
                curIndex: -1,
                ia: 10
            }), void a.tips("tips", "百度渠道禁播");
            e.isMStation ? (br.iPhone || br.iPod ? isLeSportsM ? a.staticVars.ptid = 53 : a.staticVars.ptid = 19 : isLeSportsM ? a.staticVars.ptid = 52 : a.staticVars.ptid = 4, adTools.isMStation = !0, n.DC_AD_URL = "http://apple.www.letv.com/va/?", n.SKIP_AD_CLICK = "http://apple.www.letv.com/s/?k=sumtmp;H5PADQad", n.SKIP_AD_SUCC = "http://apple.www.letv.com/s/?k=sumtmp;H5PADQadfc", a.adStyle = e.style || n.AD_STYLE.pre_roll, adTools.httpToHttps(H5AD.config.isHttps)) : (a.adStyle = e.style || [n.AD_STYLE.pre_roll, n.AD_STYLE.standard], isLeSportsH ? a.staticVars.ptid = 54 : a.staticVars.ptid = 5);
            try {
                a.staticVars.countdownID = "#" + a.putinVars.cont, a.staticVars.countdownElem = adTools.el(a.staticVars.countdownID, "div")
            } catch (d) {
                return a.callback2Player.call(a, l.stopAD, {reason: 4}), void a.sendEvent(o.OnAcComplate, {error: {code: 21}})
            }
            r = a.putinVars.ark ? a.putinVars.ark : "__ADINFO__" in window && __ADINFO__.arkId ? __ADINFO__.arkId : a.putinVars.defaultStreamid ? "!" : e.isMStation ? isLeSportsM ? "1128" : "132" : isLeSportsH ? "1129" : "91", a.staticVars.arkId = adTools.arkMapper(r), a.arkTimer = setTimeout(function () {
                adTools.debug("请求ark超时,播放正片"), a.sendEvent(o.OnAcComplate, {error: {code: 451}}), a.callback2Player.call(a, n.CALL_PLAYER_TYPE.stopAD, {reason: 5})
            }, n.REQ_ARK_TIMEOUT), a.getArkData(a.adStyle, a.staticVars.arkId, a.putinVars.vid, a.putinVars.defaultStreamid, e.uuid)
        }, getArkData: function (e, t, a, i, s) {
            var r, n = this, o = H5AD.config, l = o.SEND_EVENT_TYPE, d = n.dynamicVars;
            e instanceof Array && (e = e.join(","));
            var h = {
                ark: t,
                n: d.isFirst ? 1 : 0,
                ct: e,
                vid: a || 0,
                vvid: s || "",
                t: Math.ceil((new Date).getTime() / 1e3),
                cid: n.putinVars.cid,
                ptid: n.staticVars.ptid,
                type: n.putinVars.istrylook ? 1 : 0,
                bm: n.putinVars.vipbrand ? n.putinVars.vipbrand : "",
                hs: o.isHttps ? "1" : "0",
                v: o.isHttps ? "iPhone_" + H5AD.config.H5_ADPLAYER_VER : H5AD.config.H5_ADPLAYER_VER
            };
            "undefined" != typeof i && (i = adTools.resoSid(i), r = h.ark != adTools.arkMapper(100) ? adTools.isMStation ? br.iPhone || br.iPod ? isLeSportsM ? "1067" : "471" : isLeSportsM ? "1052" : "335" : isLeSportsH ? "1082" : "148" : h.ark, adTools.easyClone(h, {
                sid: i,
                b: "2",
                ark: r
            }), n.staticVars.arkId = r);
            var c, p = adTools.getQuery("q2"), u = adTools.getQuery("ch"), g = {
                coop_yinliu: 393,
                coop_yinliu1: 394,
                coop_yinliu2: 395,
                coop_yinliu3: 396
            }, f = {
                yl25: 1032,
                yl29: 1032,
                yl31: 1032,
                yl32: 1032,
                yl34: 1032,
                yl35: 1032,
                yl60: 1032,
                yl61: 1032,
                yl62: 1032,
                yl63: 1032,
                yl64: 1032,
                yl65: 1032,
                yl66: 1032,
                yl67: 1032,
                yl68: 1032,
                yl69: 1032,
                yl70: 1032,
                yl71: 1032,
                yl72: 1032,
                yl73: 1032,
                yl74: 1032,
                yl75: 1032
            }, v = {
                yl25: 1033,
                yl29: 1033,
                yl31: 1033,
                yl32: 1033,
                yl34: 1033,
                yl35: 1033,
                yl60: 1033,
                yl61: 1033,
                yl62: 1033,
                yl63: 1033,
                yl64: 1033,
                yl65: 1033,
                yl66: 1033,
                yl67: 1033,
                yl68: 1033,
                yl69: 1033,
                yl70: 1033,
                yl71: 1033,
                yl72: 1033,
                yl73: 1033,
                yl74: 1033,
                yl75: 1033
            }, m = {
                yl25: 1034,
                yl29: 1034,
                yl31: 1034,
                yl32: 1034,
                yl34: 1034,
                yl35: 1034,
                yl60: 1034,
                yl61: 1034,
                yl62: 1034,
                yl63: 1034,
                yl64: 1034,
                yl65: 1034,
                yl66: 1034,
                yl67: 1034,
                yl68: 1034,
                yl69: 1034,
                yl70: 1034,
                yl71: 1034,
                yl72: 1034,
                yl73: 1034,
                yl74: 1034,
                yl75: 1034
            };
            u ? (c = br.Android ? f[u] : br.iPhone ? v[u] : m[u], n.putinVars.yl_channel = u) : p && (c = g[p], n.putinVars.yl_channel = p), c && (h.ark = n.staticVars.arkId = c);
            var _ = [H5AD.config.ARK_SHOW_URL, adTools.param(h), "j=?"].join("&"), y = {
                r: adTools.getQuery("r"),
                o: adTools.getQuery("o"),
                d: adTools.getQuery("d"),
                w: adTools.getQuery("w"),
                x: adTools.getQuery("x"),
                y: adTools.getQuery("y"),
                z: adTools.getQuery("z")
            };
            d.isFirst = !1, y.w && y.x && y.y && y.z && (_ = [H5AD.config.ARK_PREVIEW_URL, adTools.param(h), adTools.param(y), "j=?"].join("&")), y = null, adTools.debug("请求ARK地址:" + _), n.getArkDataTime = lib.now(), adTools.getJSON(_, function (a) {
                n.requestLock = !1, clearTimeout(n.arkTimer);
                try {
                    n._resolveData.call(n, a, e, _, t)
                } catch (i) {
                    n.callback2Player(o.CALL_PLAYER_TYPE.playAD, []), n.sendEvent(l.OnAcComplate, {error: {code: 453}}), adTools.debug(i, "解析异常："), H5AD.collectError("827&err=reqErr&src=" + _ + "&lc=" + n.putinVars.lc, 3)
                }
            }, function (e) {
                n.sendEvent(l.OnAcComplate, {error: {code: 450}}), n.callback2Player(o.CALL_PLAYER_TYPE.stopAD, {reason: 6}), clearTimeout(n.arkTimer)
            }, o.REQ_ARK_TIMEOUT)
        }, tips: function (e, t, a) {
            switch (e) {
                case"tips":
                    adTools.debug(t)
            }
        }, _resolveData: function (e, t, a, i) {
            var s, r, n = this, o = H5AD.config, l = "-", d = 0, h = 0, c = {};
            if (n.adEventDispatcher = new H5AD.adEvent, e && e.vast) {
                if (e.vast.Policy && ("base" == n.putinVars.tplType || "live" == n.putinVars.tplType) && !n.putinVars.istrylook) {
                    var p = e.vast.Policy.CuePoint, u = 0;
                    for (var g in p)6 == p[g].type && p[g].id > u && (u = p[g].id);
                    n.staticVars.pauseCis = u
                }
                r = e.vast, n.staticVars.cuid = n.setCuidCookie(r.cuid), r.code.indexOf("110004") > 0 && (self.callback2Player.call(self, callType.stopAD, {reason: 2}), self.sendEvent(eventType.OnAcComplate, {
                    atype: "2",
                    curAD: {},
                    curIndex: -1,
                    ia: 110
                })), s = r.Ad.length, adTools.easyClone(n.staticVars, r), n.dynamicVars.preAdCount = 0, n.dynamicVars.staAdCount = 0, n.dynamicVars.preAdLc = 0, n.dynamicVars.staAdLc = 0, adTools.debug("返回广告数：" + s), n.adQueue = [], n.dynamicVars.dur_total = 0, n.dynamicVars.dur = [];
                for (var f = 0, v = function (e) {
                    var t = 0;
                    return e && (t = parseInt(Math.ceil(e / 15))), t
                }, m = 0; m < s; m++) {
                    var g = r.Ad[m];
                    if (g.parent) {
                        var g = r.Ad[m], _ = g.InLine, y = g.cuepoint_type, b = _.Creatives.Creative[0], T = {};
                        adTools.easyClone(T, g);
                        var E = new AdMaterial(this, b.Linear.AdParameters, b.Linear.VideoClicks.ClickThrough, b.Linear.VideoClicks.ClickTracking, b.Linear.TrackingEvents.Tracking, _.Impression, T.order_item_id, T.order_id, b.Linear.Duration, y, b.Linear.adzone_id, f, g.lc, g.sub, g.ord);
                        E.isSub = g.parent, c[g.parent] = E
                    } else {
                        var _ = g.InLine, y = g.cuepoint_type, b = _.Creatives.Creative[0], T = {};
                        1 === s && this.adStyle instanceof Array && (y == o.AD_STYLE.pre_roll ? this.adStyle.pop() : y == o.AD_STYLE.standard && this.adStyle.shift()), adTools.easyClone(T, g);
                        var x = new AdMaterial(this, b.Linear.AdParameters, b.Linear.VideoClicks.ClickThrough, b.Linear.VideoClicks.ClickTracking, b.Linear.TrackingEvents.Tracking, _.Impression, T.order_item_id, T.order_id, b.Linear.Duration, y, b.Linear.adzone_id, f, g.lc, g.sub, g.ord);
                        if (x.hasMZ && ++d, x.hasEX && ++h, y == o.AD_STYLE.pre_roll) {
                            if (n.adQueue.length > 0) {
                                var A = v(n.adQueue[n.adQueue.length - 1].duration);
                                x.nord = n.adQueue[n.adQueue.length - 1].nord + A
                            } else x.nord = 1;
                            n.adQueue.push(x), T.duration = x.duration, n.dynamicVars.dur.push(T.duration), n.dynamicVars.dur_total += T.duration, n.dynamicVars.preAdCount++, n.dynamicVars.preAdLc = T.lc, n.dynamicVars.adidQueue.push(T.order_item_id), f++
                        } else y != o.AD_STYLE.standard || n.putinVars.istrylook || (x.nord = 1, n.adQueue.push(x), T.duration = x.duration, n.dynamicVars.staAdCount++, n.dynamicVars.staAdLc = 1, n.dynamicVars.stadur = T.duration, l = T.order_item_id, f++)
                    }
                }
                var k = function () {
                    adTools.getAslbUrl(n.adQueue, function (e) {
                        adTools.debug(e, "返回ASLB—Data:"), n.callback2Player.call(n, o.CALL_PLAYER_TYPE.playAD, e), n.downMaterialTimer = lib.now()
                    }, n)
                }, D = function () {
                    for (var e = 0; e < n.adQueue.length; e++) {
                        var t = n.adQueue[e];
                        (t.hasEX || t.hasMZ) && (t.curAD = t, n._sendArkTracking(5, t), n._reqThirdPartyExchange(t, function (e, t, a, i, s) {
                            if ("EX" === s ? --h : "MZ" === s && --d, e && n._sendArkTracking(7, n.adQueue[a]), null == e && null == t && n._sendArkTracking(8, n.adQueue[a]), e || !t) {
                                var r;
                                if (r = c[i]) r.curIdx = a, r.nord = n.adQueue[a].nord, n.adQueue[a] = r; else {
                                    var o = [], l = n.adQueue[a].adType;
                                    n.adQueue[a] = null;
                                    for (var p = 0; p < n.adQueue.length; p++)if (n.adQueue[p]) {
                                        var u = p;
                                        if (p > a && (u -= 1, n.adQueue[p].curIdx = u, 2 == n.adQueue[p].adType))if (o.length > 0) {
                                            var g = v(o[o.length - 1].duration);
                                            n.adQueue[p].nord = o[o.length - 1].nord + g
                                        } else n.adQueue[p].nord = 1;
                                        o.push(n.adQueue[p])
                                    }
                                    if (n.adQueue = o, 2 == l) {
                                        n.dynamicVars.dur_total -= n.dynamicVars.dur[a], n.dynamicVars.preAdCount -= 1;
                                        for (var f = [], p = 0; p < n.dynamicVars.dur.length; p++)p != a && f.push(n.dynamicVars.dur[p]);
                                        n.dynamicVars.dur = f
                                    } else 3 == l && (n.dynamicVars.stadur -= 5, n.dynamicVars.staAdCount -= 1)
                                }
                                return void(0 === h && 0 === d && k())
                            }
                            n._sendArkTracking(6, n.adQueue[a]), n.adQueue[t.curIdx] = t, 0 === h && 0 === d && k()
                        }))
                    }
                };
                (d || h) && (d > 0 || h > 0) ? D() : k();
                var P = "";
                r.code.indexOf("110004") > -1 && (P = 110), n.sendEvent(o.SEND_EVENT_TYPE.OnAcComplate, {
                    atype: "2",
                    ct: n.dynamicVars.preAdCount,
                    ia: P
                }), adTools.isMStation === !1 && n.sendEvent(o.SEND_EVENT_TYPE.OnAcComplate, {
                    atype: "3",
                    ct: n.dynamicVars.staAdCount,
                    dur: n.dynamicVars.stadur || "0",
                    oiid: l,
                    ia: P
                })
            } else n.callback2Player.call(n, o.CALL_PLAYER_TYPE.playAD, []), n.sendEvent(o.EVENT_TYPE.OnAcComplate, {error: {code: 453}})
        }, _reqThirdPartyExchange: function (e, t) {
            var a, i = this, s = H5AD.config;
            if (e)if (e.hasMZ) i._reqThirdParty(e, t); else if (e.hasEX === !0) {
                a = e.url, a.indexOf("[LETV_V_URL]") > -1 && (a = a.replace("[LETV_V_URL]", encodeURIComponent(location.href))), a += a.indexOf("?") > -1 ? "&" : "?";
                var r, n = 0;
                br.iPhone || br.iPad ? (r = "IOS", br.iPad && (n = 1)) : br.Android || br.AndroidPad ? (r = "ANDROID", br.AndroidPad && (n = 1)) : r = "OTHERS";
                var o = {h: r, l: n};
                a += adTools.param(o), a += "&j=?", adTools.getJSON(a, function (a) {
                    try {
                        if (!a || !a.vast.Ad || 0 == a.vast.Ad.length || a.vast.Ad[0] && !a.vast.Ad[0].InLine)return t(null, null, e.curIdx, e.oid, "EX");
                        var s = a.vast.Ad[0], r = s.InLine, n = r.Creatives.Creative[0], o = n.Linear.Icons, l = "";
                        o && o.Icon && (l = o.Icon.cdata);
                        var d = new AdMaterial(i, n.Linear.MediaFiles.MediaFile.cdata, n.Linear.VideoClicks.ClickThrough, n.Linear.VideoClicks.ClickTracking, n.Linear.TrackingEvents.Tracking, r.Impression, "", "", "", "", "", 0, "", "", "", (!0));
                        e.iconUrl = l, e.impression = d.impression, e.event || (e.event = []), e.event = e.event.concat(d.event), e.clickUrl = d.clickUrl, e.tracking || (e.tracking = []), e.tracking = e.tracking.concat(d.tracking), e.url = d.url, t(null, e, e.curIdx, e.oid, "EX")
                    } catch (h) {
                        console.log(h)
                    }
                }, function (a) {
                    a = a || {reason: "timeout"}, t(a, null, e.curIdx, e.oid, "EX")
                }, s.REQ_ARK_TIMEOUT)
            }
            return e
        }, _reqThirdParty: function (e, t) {
            var a, i = H5AD.config;
            if (e && e.hasMZ === !0) {
                a = e.url;
                var s = adTools.getQuery("v", a);
                s ? a = a.replace(new RegExp("v=" + s), "v=2&c=?") : a += "v=2&c=?", adTools.getJSON(a, function (a) {
                    try {
                        if (!a || a && !a.src)return t(null, null, e.curIdx, e.oid, "MZ");
                        if (e.url = a.src || "", e.clickUrl || (e.clickUrl = a.ldp || ""), e.tracking.constructor == Array && e.tracking.concat(a.cm || []), a.pm)for (var i in a.pm)if (a.pm.hasOwnProperty(i))if ("0" == i) e.impression.concat(a.pm[i]); else if (a.pm[i].constructor == Array)for (var s = 0; s < a.pm[i].length; s++) {
                            var r = a.pm[i][s];
                            "" != r && (e.event.push({
                                event: "progress",
                                offset: i,
                                cdata: r
                            }), e.progressTicks.push(parseInt(i) || 0))
                        }
                        t(null, e, e.curIdx, e.oid, "MZ")
                    } catch (n) {
                    }
                }, function (a) {
                    a = a || {reason: "timeout"}, t(a, null, e.curIdx, e.oid, "MZ")
                }, i.REQ_ARK_TIMEOUT)
            }
            return e
        }, _reqThirdPartyNonExchange: function (e, t) {
            var a, i = this;
            H5AD.config;
            if (e && e.hasEX === !0) {
                a = e.url, a.indexOf("[LETV_V_URL]") > -1 && (a = a.replace("[LETV_V_URL]", encodeURIComponent(location.href))), a += a.indexOf("?") > -1 ? "&" : "?";
                var s, r = 0;
                br.iPhone || br.iPad ? (s = "IOS", br.iPad && (r = 1)) : br.Android || br.AndroidPad ? (s = "ANDROID", br.AndroidPad && (r = 1)) : s = "OTHERS";
                var n = {h: s, l: r};
                a += adTools.param(n), a += "&j=?", adTools.getJSON(a, function (a) {
                    try {
                        if (!a || !a.vast.Ad || 0 == a.vast.Ad.length || a.vast.Ad[0] && !a.vast.Ad[0].InLine)return t(null, null, 0, e.oid, "EX");
                        var s = a.vast.Ad[0], r = s.InLine, n = r.Creatives.Creative[0], o = n.NonLinearAds.Icons, l = "";
                        o && o.Icon && (l = o.Icon.cdata);
                        var d = new AdMaterial(i, n.NonLinearAds.StaticResource.cdata, n.NonLinearAds.NonLinear.NonLinearClickThrough, n.NonLinearAds.NonLinear.NonLinearClickTracking, "", r.Impression, "", "", "", "", "", 0, "", "", "", (!0));
                        e.iconUrl = l, e.impression = d.impression, e.event || (e.event = []), e.event = e.event.concat(d.event), e.clickUrl = d.clickUrl, e.tracking || (e.tracking = []), e.tracking = e.tracking.concat(d.tracking), e.url = d.url, t(null, e, 0, e.oid, "EX")
                    } catch (h) {
                        console.log(h)
                    }
                }, function (a) {
                    a = a || {reason: "timeout"}, t(a, null, e.curIdx, e.oid, "EX")
                }, 2e3)
            }
            return e
        }, getPauseData: function (e) {
            var t = this, a = H5AD.config, i = t.putinVars, s = t.staticVars.arkId, r = a.SEND_EVENT_TYPE;
            if (t.isPauseState = 1, t.putinVars.isvip && "base" == t.putinVars.tplType && !adTools.isMStation)return void t.sendEvent(r.OnAcComplate, {
                atype: "6",
                curAD: {},
                curIndex: -1,
                ia: t.putinVars.isvip
            });
            if (t.staticVars.pauseCis && !adTools.isMStation) {
                e && (t.dynamicVars.pauseOnTime = e.onTime || 0);
                var n = {
                    ark: s,
                    n: 0,
                    cis: t.staticVars.pauseCis || 0,
                    vid: i.vid || 0,
                    vvid: i.uuid || "",
                    t: Math.ceil((new Date).getTime() / 1e3),
                    hs: a.isHttps ? "1" : "0",
                    v: a.isHttps ? "iPhone_" + H5AD.config.H5_ADPLAYER_VER : H5AD.config.H5_ADPLAYER_VER
                };
                if (i.defaultStreamid) {
                    var o = adTools.resoSid(i.defaultStreamid);
                    adTools.easyClone(n, {sid: o, b: "2"})
                }
                var l = [H5AD.config.ARK_SHOW_URL, adTools.param(n), "j=?"].join("&"), d = {
                    r: adTools.getQuery("r"),
                    o: adTools.getQuery("o"),
                    d: adTools.getQuery("d"),
                    w: adTools.getQuery("w"),
                    x: adTools.getQuery("x"),
                    y: adTools.getQuery("y"),
                    z: adTools.getQuery("z")
                };
                d.w && d.x && d.y && d.z && (l = [H5AD.config.ARK_PREVIEW_URL, adTools.param(n), adTools.param(d), "j=?"].join("&")), d = null, adTools.debug("暂停广告请求ARK地址:" + l), t.getArkDataTime = lib.now(), t.startTime = lib.now(), adTools.getJSON(l, function (e) {
                    try {
                        t._resolveNonLinearData.call(t, e, 6, l, s)
                    } catch (a) {
                        t.sendEvent(r.OnAcComplate, {
                            atype: 6,
                            error: {code: 453}
                        }), adTools.debug(a, "解析异常："), H5AD.collectError("827&err=reqErr&src=" + l + "&lc=" + t.putinVars.lc, 3)
                    }
                }, function (e) {
                    t.sendEvent(r.OnAcComplate, {atype: 6, error: {code: 450}})
                }, 2e3)
            }
        }, _resolveNonLinearData: function (e, t, a, i) {
            var s, r, n = this, o = H5AD.config, l = {};
            if (e && e.vast) {
                if (r = e.vast, n.setCuidCookie(r.cuid), r.code.indexOf("110004") > 0)return void self.sendEvent(eventType.OnAcComplate, {
                    atype: "6",
                    curAD: {},
                    curIndex: -1,
                    ia: 110
                });
                s = r.Ad.length, adTools.easyClone(n.staticVars, r), n.adPauseQueue = [];
                for (var d = 0, h = 0, c = 0; c < s; c++) {
                    var p = r.Ad[c];
                    if (p.parent) {
                        var u = p.InLine, g = p.cuepoint_type, f = u.Creatives.Creative[0], v = {};
                        adTools.easyClone(v, p), h = v.order_item_id;
                        var m = new AdMaterial(this, f.NonLinearAds.NonLinear[0].AdParameters, f.NonLinearAds.NonLinear[0].NonLinearClickThrough, f.NonLinearAds.NonLinear[0].NonLinearClickTracking, f.NonLinearAds.TrackingEvents.Tracking, u.Impression, v.order_item_id, v.order_id, 0, g, f.NonLinearAds.NonLinear[0].adzone_id, d, p.lc, p.sub, p.ord);
                        m.isSub = p.parent, l[p.parent] = m
                    } else {
                        var u = p.InLine, g = p.cuepoint_type, f = u.Creatives.Creative[0], v = {};
                        adTools.easyClone(v, p), h = v.order_item_id;
                        var _ = new AdMaterial(this, f.NonLinearAds.NonLinear[0].AdParameters, f.NonLinearAds.NonLinear[0].NonLinearClickThrough, f.NonLinearAds.NonLinear[0].NonLinearClickTracking, f.NonLinearAds.TrackingEvents.Tracking, u.Impression, v.order_item_id, v.order_id, 0, g, f.NonLinearAds.NonLinear[0].adzone_id, d, p.lc, p.sub, p.ord), y = adTools.json(f.NonLinearAds.NonLinear[0].AdParameters);
                        _.adWidth = y.width || 0, _.adHeight = y.height || 0, n.adPauseQueue.push(_)
                    }
                }
                var b = function (e) {
                    n._sendArkTracking(5, e), n._reqThirdPartyNonExchange(e, function (e, t, a, i, s) {
                        if (e && n._sendArkTracking(7, n.adPauseQueue[0]), null == e && null == t && n._sendArkTracking(8, n.adPauseQueue[0]), e || !t) {
                            var r = {};
                            r = l[i], r ? (n.adPauseQueue[0] = r, n.adPauseQueue[0].curAD = r) : n.adPauseQueue = []
                        } else n._sendArkTracking(6, n.adPauseQueue[0]), n.adPauseQueue[0] = t;
                        n.adPauseQueue.length > 0 && n.renderPauseAd()
                    })
                }, T = "";
                if (r.code.indexOf("110004") > -1 && (T = 110), n.sendEvent(o.SEND_EVENT_TYPE.OnAcComplate, {
                        oiid: h,
                        atype: "6",
                        ct: "1",
                        ia: T
                    }), n.adPauseQueue[0] && n.adPauseQueue[0].hasEX) {
                    var E = n.adPauseQueue[0];
                    E.curAD = E, b(E)
                } else n.adPauseQueue[0] && n.adPauseQueue[0].url && n.renderPauseAd()
            } else n.callback2Player.call(n, o.CALL_PLAYER_TYPE.playAD, []), n.sendEvent(o.EVENT_TYPE.OnAcComplate, {
                atype: "6",
                error: {code: 453}
            })
        }, renderPauseAd: function (e) {
            var t = this;
            if (t.staticVars.pauseCis && !adTools.isMStation && t.isPauseState) {
                var a = "", i = "", s = 0, r = 0, n = t.adPauseQueue[0];
                if (n.url) {
                    n && 6 == n.adType && (a = n.url, i = n.iconUrl, s = n.adWidth || 520, r = n.adHeight || 295);
                    var o = t.staticVars.countdownElem, l = adTools.el("#pause_a_content" + t.fid);
                    adTools.existEl(l) && adTools.removeElem(l), l = lib.createElement("div", {
                        id: "pause_a_content" + t.fid,
                        className: "hv_pause_content"
                    });
                    var d = "";
                    i && (d = lib.createElement("img", {
                        id: "dsp_a_ico" + t.fid,
                        src: i,
                        width: "30px",
                        height: "30px"
                    }), d.style.cssText = "z-index:1001;width:25px;height:25px;position:absolute;bottom:2px;left:2px;");
                    var h = lib.createElement("img", {
                        id: "close_a_ico" + t.fid,
                        src: "//i1.letvimg.com/lc06_img/201605/17/14/39/delete@3x.png",
                        width: "30px",
                        height: "30px"
                    });
                    h.style.cssText = "z-index:1001;width:30px;height:30px;position:absolute;top:-15px;right:-15px;", pauseDiv = lib.createElement("div", {id: "pause_a_img_div" + t.fid});
                    var c = null;
                    /^http.+(html)$/.test(a) ? (c = lib.createElement("iframe", {
                            id: "pause_a_img" + t.fid,
                            src: a,
                            frameborder: "no",
                            border: "0",
                            marginwidth: "0",
                            marginheight: "0",
                            scrolling: "no"
                        }), l.style.cssText = "z-index:1000;position: absolute;top: 50%;left: 50%;margin: -147.5px 0 0 -260px;", pauseDiv.style.cssText = "height:295px;overflow: hidden;", c.style.cssText = "height:100%;width:100%;border:0;") : (c = lib.createElement("img", {
                            id: "pause_a_img" + t.fid,
                            src: a
                        }), l.style.cssText = "box-shadow:5px 5px 5px rgb(100, 100, 100); z-index:1000;position: absolute;top: 50%;left: 50%;margin: -147.5px 0 0 -260px;", pauseDiv.style.cssText = "width:520px;height:295px;overflow: hidden;", c.style.cssText = "height:100%;width:100%;border:0;"), d && pauseDiv.appendChild(d), pauseDiv.appendChild(h), pauseDiv.appendChild(c), l.appendChild(pauseDiv), l.style.display = "block", o.appendChild(l), t._sendUserLog(1, {
                        oiid: n.order_item_id,
                        curAD: n,
                        curIndex: 0
                    }), t._sendArkTracking(1, {curAD: n, curIndex: 0}), n.sendEvent("start", t._sendArkTracking);
                    var p = function (e) {
                        e.stopPropagation(), e.cancelBubble = !0, t._sendUserLog(2, {
                            oiid: n.order_item_id,
                            curAD: n,
                            curIndex: 0
                        }), t._sendArkTracking(2, {
                            curAD: n,
                            curIndex: 0
                        }), targetUrl = t._getCtUrl(n, 2), t.pid && t.vid ? t.openInApp(t.pid, t.vid) : n.clickUrl && window.open(targetUrl, "_blank")
                    }, u = function (e) {
                        e.stopPropagation(), e.cancelBubble = !0, t.dynamicVars.pauseOnTime = 0, adTools.existEl(l) && (adTools.removeElem(l), t._sendUserLog(3, {
                            oiid: n.order_item_id,
                            curAD: n,
                            curIndex: 0
                        }), t.adPauseQueue = [])
                    };
                    adTools.bind($js(pauseDiv), p), adTools.bind($js(h), u)
                }
            }
        }, closePauseRender: function (e) {
            var t = this;
            if (t.isPauseState = 0, t.staticVars.pauseCis && !adTools.isMStation) {
                var a = adTools.el("#pause_a_content" + t.fid);
                t.dynamicVars.pauseOnTime = 0, adTools.existEl(a) && (adTools.removeElem(a), t._sendUserLog(3, {
                    oiid: t.adPauseQueue[0].order_item_id,
                    curAD: t.adPauseQueue[0],
                    curIndex: 0
                }), t.adPauseQueue = [])
            }
        }, retry: function (e) {
            return
        }, _getUniqueId: function () {
            var e = Math;
            return "ad_" + Array.prototype.join.call(arguments, "_") + String(e.ceil(1e4 * e.random()))
        }, sendEvent: function (e, t) {
            var a = this;
            try {
                var i = H5AD.config, s = i.SEND_EVENT_TYPE, r = t.curAD;
                if (!r && e != s.OnAcComplate && e != s.OnRefreshAd)return void H5AD.collectError("1827&err=itemIsNull&type=" + e + "&lc=" + a.putinVars.lc, 3);
                switch (e) {
                    case s.OnAcComplate:
                        a._sendUserLog(0, t), adTools.debug("AC结束");
                        break;
                    case s.OnStart:
                        if (adTools.debug(t.curIndex + " 开始播放广告"), "0" == a.dynamicVars.dur_total && "0" == a.dynamicVars.staAdCount)return;
                        a.dynamicVars.hasPlayed === !1 && (0 == t.curIndex && a._sendUserLog(6, t), a._sendUserLog(1, t), r && !r.mppt && a._sendArkTracking(1, t), r.sendEvent("start", a._sendArkTracking));
                        var n = a.callback2Player.call(a, i.CALL_PLAYER_TYPE.getRealTime);
                        0 == n && (a.playingMonitorCount = a.playingMonitorCount || 0, a.playingMonitor && clearTimeout(a.playingMonitor), a.playingMonitor = setTimeout(function () {
                            if (++a.playingMonitorCount, a.playingMonitorCount > 5)return void(a.playingMonitorCount = null);
                            var e = a.callback2Player.call(a, i.CALL_PLAYER_TYPE.getRealTime);
                            0 == e && a.callback2Player.call(a, i.CALL_PLAYER_TYPE.resumeAD)
                        }, 2e3)), a.dynamicVars.hasPlayed = !0, r.adType == i.AD_STYLE.pre_roll ? (r.seeDetail(), r.iconUrl && r.seeDSPIcon(r.iconUrl), r.closeBigPlay(), r.renderRealCd(a.dynamicVars.dur_total, t, a.dynamicVars.dur), a.playAdTimer = a.playAdTimer || [], clearTimeout(a.playAdTimer[t.curIndex]), a.playAdTimer[t.curIndex] = setTimeout(function () {
                                adTools.debug(t.curIndex + " 广告播放超时"), lib.merge(t, {error: {code: 461}}), a._sendUserLog(1, t), a.callback2Player.call(a, i.CALL_PLAYER_TYPE.stopAD, {reason: 7}), r.closeCountDown()
                            }, 1e3 * r.duration + i.DOWNLOAD_URL_TIMEOUT)) : r.adType == i.AD_STYLE.standard && (r.seeDetail(), r.closeBigPlay(), a.playAdTimer = a.playAdTimer || [], clearTimeout(a.playAdTimer[t.curIndex]), a.playAdTimer[t.curIndex] = setTimeout(function () {
                                adTools.debug(t.curIndex + " 广告播放超时"), lib.merge(t, {error: {code: 461}}), a._sendUserLog(1, t), a.callback2Player.call(a, i.CALL_PLAYER_TYPE.stopAD, {reason: 8}), r.closeSeeDetail()
                            }, 1e3 * r.duration + i.DOWNLOAD_URL_TIMEOUT)), adTools.debug(t.curIndex + " 开始播放广告");
                        break;
                    case s.OnComplate:
                        r.adType == i.AD_STYLE.pre_roll ? (r.closeSeeDetail(), r.closeSeeDSPIcon(), r.closeBigPlay(t), t.curIndex + 1 == a.dynamicVars.preAdCount ? r.closeCountDown() : r.pauseCountDown(), t.curIndex + 1 == a.dynamicVars.preAdCount && 0 == a.dynamicVars.staAdCount && a._sendUserLog(7, t)) : r.adType == i.AD_STYLE.standard && (r.closeCountDown(), a._sendUserLog(7, t)), clearTimeout(a.playAdTimer[t.curIndex]), a._sendUserLog(3, t), r.sendEvent("complete", a._sendArkTracking), adTools.debug(t.curIndex + "段广告播放完成"), a.dynamicVars.hasPlayed = !1;
                        break;
                    case s.OnClick:
                        break;
                    case s.OnPause:
                        a.playingMonitor && clearTimeout(a.playingMonitor), a.playAdTimer && a.playAdTimer.length > 0 && clearTimeout(a.playAdTimer[t.curIndex]), r.pauseCountDown(), r.renderBigPlay(t), adTools.debug(t.curIndex + " 暂停");
                        break;
                    case s.OnError:
                        if (a._sendUserLog(1, t), r.adType == i.AD_STYLE.pre_roll) {
                            clearTimeout(a.playAdTimer[t.curIndex]);
                            for (var o = a.dynamicVars.dur_total, l = 0; l < t.curIndex; l++)o -= a.dynamicVars.dur[l];
                            r.closeCountDown()
                        }
                        adTools.debug(t.error, t.curIndex + " 播放器遇到错误，回调"), a.dynamicVars.hasPlayed = !1;
                        break;
                    case s.OnASLB:
                        a._sendUserLog(5, t);
                        break;
                    case s.OnLoginAc:
                        r.loginAc(t.level);
                        break;
                    case s.OnRefreshAd:
                        adTools.destoryJsonp();
                        break;
                    case s.OnTimeUpdate:
                        a.adEventDispatcher && a.adEventDispatcher.fire("OnTimeUpdate")
                }
            } catch (d) {
                H5AD.collectError("974," + (d || {}).stack, 3)
            }
        }, _sendUserLog: function (e, t) {
            t = t || {};
            var a = this, i = H5AD.config, s = a.putinVars, r = a.dynamicVars, n = Math;
            r.dur || lib.merge(r, {dur: ["-"], dur_total: "-", adCount: 0}), _adItem = t.curAD || {};
            var o = {
                act: "event",
                atype: t.atype || _adItem.adType,
                id: "-",
                ia: 0,
                err: 0,
                lc: s.lc || "-",
                ver: "2.0",
                aps: i.H5_ADPLAYER_VER,
                ch: s.yl_channel || s.ch || "letv",
                cid: s.cid || "-",
                ct: _adItem.lc || 0,
                dur: t.dur || r.dur.join("_") || "0",
                dur_total: t.dur || r.dur_total || "0",
                mmsid: s.mmsid || "-",
                pid: s.pid || "-",
                r: n.ceil(n.random() * lib.now()),
                cur_url: encodeURIComponent(location.href),
                ry: r.retry || 0,
                ref: encodeURIComponent(document.referrer) || "-",
                sys: 1,
                uname: s.uname || "-",
                uid: s.uid || "-",
                py: s.up,
                uuid: s.uuid,
                pv: s.ver,
                vid: s.vid || "-",
                vlen: s.gdur || "-",
                p1: s.p1,
                p2: s.p2,
                ontime: r.pauseOnTime || "-",
                p3: s.p3 == s.p3 ? "-" : s.p3,
                ty: s.islive ? 1 : 0,
                ctime: lib.now()
            }, l = {
                act: "event",
                aps: i.H5_ADPLAYER_VER,
                cid: s.cid || "-",
                ct: 0,
                dur_total: 0,
                err: 0,
                lc: s.lc || "-",
                p1: s.p1,
                p2: s.p2,
                p3: s.p3 == s.p3 ? "-" : s.p3,
                pid: s.pid || "-",
                r: n.ceil(n.random() * lib.now()),
                ty: s.islive ? 1 : 0,
                uid: s.uid || "-",
                uuid: s.uuid,
                ver: "2.0",
                vid: s.vid || "-",
                astatus: "0",
                ctime: lib.now()
            };
            switch (e) {
                case 0:
                    "undefined" != typeof o.py && "" !== o.py && null != o.py ? o.py = o.py + "&ark=" + a.staticVars.arkId : o.py = "ark=" + a.staticVars.arkId, o.act = "ac", o.ry = i.retryCount, o.ia = t.ia || "0", parseInt(s.isvip) && (o.ia = t.isvip || "1", o.ry = "0"), t.error && (o.err = t.error.code), o.ut = lib.now() - a.getArkDataTime || 0, "3" == o.atype && (o.atype = "13"), o.oiid = t.oiid || a.dynamicVars.adidQueue.join("_") || "-", a._sendData(H5AD.config.DC_AD_URL + adTools.param(o));
                    break;
                case 1:
                    if (o.ut = lib.now() - a.downMaterialTimer || 0, a.lastCostTime = o.ut, t.error) {
                        switch (t.error.code) {
                            case 1:
                                o.err = 460;
                                break;
                            case 2:
                                o.err = 461;
                                break;
                            case 3:
                                o.err = 463;
                                break;
                            case 4:
                                o.err = 469;
                                break;
                            default:
                                o.err = t.error.code || 0
                        }
                        o.loc = encodeURIComponent(_adItem.url)
                    }
                    "undefined" != typeof o.py && "" !== o.py && null != o.py ? o.py = o.py + "&ark=" + a.staticVars.arkId + "&slotid=" + _adItem.aduid : o.py = "ark=" + a.staticVars.arkId + "&slotid=" + _adItem.aduid, o.dur = _adItem.duration, o.ftype = "video", o.id = e, o.ry = i.retryCount, o.atype = _adItem.adType, o.ord = _adItem.ord || (parseInt(_adItem.curIdx) || 0) + 1, o.ct > 0 && o.ord > o.ct && (o.ord = _adItem.ord || 1, H5AD.collectError("1129&data=" + o.ord + "&idx=" + _adItem.curIndex + "&lc=" + a.putinVars.lc, 3)), o.atype == i.AD_STYLE.standard && (o.dur_total = o.dur, o.ord = 1), 6 == o.atype && (o.ord = 0), "3" == o.atype && (o.atype = "13"), o.oiid = _adItem.oid || a.dynamicVars.adidQueue[t.curIndex], o.nord = _adItem.nord ? _adItem.nord : 0, o.parent_id = _adItem.isSub ? _adItem.isSub : 0, a._sendData(H5AD.config.DC_AD_URL + adTools.param(o));
                    break;
                case 2:
                case 3:
                    "undefined" != typeof o.py && "" !== o.py && null != o.py ? o.py = o.py + "&ark=" + a.staticVars.arkId + "&slotid=" + _adItem.aduid : o.py = "ark=" + a.staticVars.arkId + "&slotid=" + _adItem.aduid, o.dur = _adItem.duration, o.ut = lib.now() - a.downMaterialTimer - a.lastCostTime || 0, o.ftype = "video", o.id = e, o.atype = _adItem.adType, o.ord = _adItem.ord || (parseInt(_adItem.curIdx) || 0) + 1, o.ct > 0 && o.ord > o.ct && (o.ord = _adItem.ord || 1, H5AD.collectError("1129&data=" + o.ord + "&idx=" + _adItem.curIndex + "&lc=" + a.putinVars.lc, 3)), o.atype == i.AD_STYLE.standard && (o.dur_total = o.dur, o.ord = 1), 6 == o.atype && (o.ord = 0), "3" == o.atype && (o.atype = "13"), o.oiid = _adItem.oid || a.dynamicVars.adidQueue[_adItem.curIdx], o.nord = _adItem.nord ? _adItem.nord : 0, o.parent_id = _adItem.isSub ? _adItem.isSub : 0, a._sendData(H5AD.config.DC_AD_URL + adTools.param(o)), 3 == e && (a.downMaterialTimer = lib.now());
                    break;
                case 5:
                    adTools.debug("ASLB结束"), _adItem.err && (o.loc = encodeURIComponent(_adItem.url), o.err = _adItem.err), "undefined" != typeof o.py && "" !== o.py && null != o.py ? o.py = o.py + "&ark=" + a.staticVars.arkId + "&slotid=" + _adItem.aduid : o.py = "ark=" + a.staticVars.arkId + "&slotid=" + _adItem.aduid, o.act = "aslb", o.ut = _adItem.costTime, o.ry = "undefined" == typeof _adItem.ryCount ? i.retryCount : _adItem.ryCount, o.atype = _adItem.adType, o.ord = _adItem.ord || (parseInt(_adItem.curIdx) || 0) + 1, o.ct > 0 && o.ord > o.ct && (o.ord = _adItem.ord || 1), o.atype == i.AD_STYLE.standard && (o.ord = 1, H5AD.collectError("1129&data=" + o.ord + "&idx=" + _adItem.curIndex + "&lc=" + a.putinVars.lc, 3)), o.oiid = _adItem.oid || a.dynamicVars.adidQueue[_adItem.curIdx], delete o.ct, delete o.dur, delete o.dur_total, delete o.ia, "3" == o.atype && (o.atype = "13"), o.nord = _adItem.nord ? _adItem.nord : 0, o.parent_id = _adItem.isSub ? _adItem.isSub : 0, a._sendData(H5AD.config.DC_AD_URL + adTools.param(o));
                    break;
                case 6:
                    adTools.debug("AB 前置广告开始"), l.act = "ab", t.error && (l.err = t.error.code), "number" == typeof r.preAdLc && (l.ct += r.preAdLc), "number" == typeof r.staAdLc && (l.ct += r.staAdLc), "number" == typeof r.dur_total && (l.dur_total += r.dur_total), "number" == typeof r.stadur && (l.dur_total += r.stadur), a._sendData(H5AD.config.DC_AD_URL + adTools.param(l));
                    break;
                case 7:
                    adTools.debug("AE 前置广告结束"), l.act = "ae", t.error && (l.err = t.error.code), "number" == typeof r.preAdLc && (l.ct += r.preAdLc), "number" == typeof r.staAdLc && (l.ct += r.staAdLc), "number" == typeof r.dur_total && (l.dur_total += r.dur_total), "number" == typeof r.stadur && (l.dur_total += r.stadur), a._sendData(H5AD.config.DC_AD_URL + adTools.param(l))
            }
        }, _getCtUrl: function (e, t) {
            return t = t || 2, this._getAttachParam(e.clickUrl, e.aduid, t, 1, e)
        }, _getAdStyle: function (e) {
            return this.adStyle ? this.adStyle instanceof Array && this.adStyle.length - 1 >= e ? this.adStyle[e] : this.adStyle : null
        }, _sendArkTracking: function (e, t) {
            var a, i = this, s = [], r = t ? t.curAD : {};
            switch (e) {
                case 1:
                    for (s = r.impression, a = 0; a < s.length; a++) {
                        var n = "";
                        "object" == typeof s[a] ? s[a].cdata && s[a].cdata.length > 0 && (n = s[a].cdata) : n = s[a], i._sendData(i._getAttachParam, n, r.aduid, e, 1, r), r.impression = []
                    }
                    break;
                case 2:
                    for (s = r.tracking, a = 0; a < s.length; a++) {
                        var n = "";
                        "object" == typeof s[a] ? s[a].cdata && s[a].cdata.length > 0 && (n = s[a].cdata) : n = s[a], i._sendData(i._getAttachParam, n, r.aduid, 3, 1, r)
                    }
                    break;
                case 4:
                    s = t;
                    var r = arguments[2];
                    if (s && s.length > 0)for (a = 0; a < s.length; a++) {
                        var o, n = "";
                        "object" == typeof s[a] ? (s[a].cdata && s[a].cdata.length > 0 && (n = s[a].cdata), o = s[a].type && s[a].type.length > 0 ? s[a].type : e, i._sendData(i._getAttachParam, n, r.aduid, o, 1, r)) : (n = s[a], i._sendData(i._getAttachParam, n, r.aduid, e, 1, r))
                    }
                    break;
                case 5:
                    if (s = r.reqImpr, s && s.constructor == Array)for (a = 0; a < s.length; a++)i._sendData(i._getAttachParam, s[a].cdata, r.aduid, 1, 1, r);
                    break;
                case 6:
                    if (s = r.reqResult, s && s.constructor == Array)for (a = 0; a < s.length; a++)i._sendData(i._getAttachParam, s[a], r.aduid, 4, 1, r);
                    break;
                case 7:
                    if (s = r.reqError, s && s.constructor == Array)for (a = 0; a < s.length; a++)"reach_err_0" === s[a].event && i._sendData(i._getAttachParam, s[a].cdata, r.aduid, 4, 1, r);
                    break;
                case 8:
                    if (s = r.reqError, s && s.constructor == Array)for (a = 0; a < s.length; a++)"reach_err_4" === s[a].event && i._sendData(i._getAttachParam, s[a].cdata, r.aduid, 4, 1, r)
            }
        }, _getAttachParam: function (e, t, a, i, s) {
            var r = this, n = H5AD.config;
            if (s && 6 == s.adType && (s.ord = 0), "object" == typeof e && e.cdata)return e = e.cdata;
            if (!e || "javascript:void(0)" === e)return "javascript:void(0)";
            if (e.indexOf(n.ARK_DOMAIN) > -1) {
                var o = (new Date).getTime(), l = r.staticVars, d = r.putinVars, h = l.stime + Math.ceil((o - r.startTime) / 1e3), c = s.isSub ? s.isSub : 0, p = s.nord ? s.nord : 0, u = {
                    rt: a,
                    oid: s.oid,
                    im: void 0 === i ? 1 : i,
                    t: h,
                    cuid: l.cuid,
                    data: [t, l.area_id, l.arkId || 0, d.uuid, s.orderid, d.vid || "", d.pid || "", d.cid || "", s.lc || "1", s.adType || "2", r.putinVars.yl_channel || r.putinVars.ch || "letv", adTools.resoSid(r.putinVars.defaultStreamid) || "", s.ord + "" || s.curIdx + 1 || 0, Math.ceil(o / 1e3), 0, r.putinVars.ver, "", 0, "", h, c, "", "", r.staticVars.ptid, r.putinVars.istrylook ? 1 : 0, r.putinVars.vipbrand ? r.putinVars.vipbrand : 0, "", "", p].join(",")
                };
                if (u.s = r._getSecurityKey(u), 2 == a) {
                    e = r._replaceUrlArguments(e, t, a, i, s);
                    var g = e.split("&u=");
                    e = [g[0], adTools.param(u), "u=" + g[1]].join("&")
                } else e += "&" + adTools.param(u)
            } else e = r._replaceUrlArguments(e, t, a, i, s);
            return e
        }, _replaceUrlArguments: function (e, t, a, i, s) {
            var r = this, n = {
                "[randnum]": (new Date).getTime(),
                "[M_IESID]": "LETV_" + t,
                "[M_ADIP]": r.staticVars.ip,
                "[A_ADIP]": r.staticVars.ip,
                __LE_VID__: r.putinVars.vid
            }, o = r.is_need_video_info;
            if (o)try {
                for (var l = o.split("|"), d = "letv_", h = 0; h < l.length; ++h)d += (r.putinVars[l[h]] || 0) + "_";
                d = d.substr(0, d.length - 1), n.__DRA__ = d
            } catch (c) {
            }
            for (var p in n)n.hasOwnProperty(p) && e.indexOf(p) >= 0 && (e = e.replace(p, n[p]));
            return e
        }, _getSecurityKey: function (e) {
            var t = H5AD.config.crc_table, a = 0, i = 0, s = 0, r = "", n = "";
            for (var a in H5AD.config.securityKeys)n += e[H5AD.config.securityKeys[a]];
            for (r = n.length, a = 0; a < r; a++) {
                var o = n.charCodeAt(a), l = 15 & i | (15 & o) << 4;
                s = t[l], i = i >> 4 ^ s, s = t[15 & i | 240 & o], i = i >> 4 ^ s
            }
            return i.toString(16)
        }, _sendData: function (e) {
            var t = e;
            if ("function" == typeof arguments[0] && (t = arguments[0].apply(this, [].slice.call(arguments, 1))), t && "" != t) {
                var a = lib.createElement("img", {src: t});
                adTools.debug("发起url : " + t), $js(a).on("load", function () {
                    a = null
                })
            }
        }, setCuidCookie: function (e) {
            var t = lib.getCookie("ark_uuid");
            return location.host.indexOf(".le.com") >= 0 && e && (!t || t != e) && (t = e, lib.setCookie("ark_uuid", e, {
                expires: new Date(2060, 0, 1, 8, 0, 1),
                domain: "le.com"
            })), t
        }
    }, H5AD.collectError = function (e, t) {
    }, H5AD.adEvent = function () {
        this.ad_eventlistener = {}
    }, H5AD.adEvent.prototype = {
        on: function (e, t, a) {
            var i = this.ad_eventlistener[e];
            void 0 === i && (i = [], this.ad_eventlistener[e] = i);
            var s = {type: e, func: t, context: a};
            return i.push(s), s
        }, off: function (e, t, a) {
            var i = this.ad_eventlistener[e];
            if (void 0 !== i)for (var s = i.length, r = 0; r < s; r++) {
                var n = i[r];
                if (n.type == e && n.context === a)return void i.splice(r, 1)
            }
        }, fire: function (e, t) {
            var a = this.ad_eventlistener[e];
            if (void 0 !== a)for (var i = a.length, s = 0; s < i; s++) {
                var r = a[s], n = r.func, o = r.context;
                null != o ? n.call(o, t) : n(t)
            }
        }
    }, AdMaterial.prototype = {
        resolveAdParam: function (e) {
            var t = adTools.json(e);
            t.hdurl && t.hdurl.length > 0 && adTools.getDeviceSize.x > 960 && adTools.getDeviceSize.y > 640 ? this.url = t.hdurl : t.hpg_url && t.hpg_url.length > 0 ? (this.url = t.hpg_url, this.hasMZ = !0) : t.reachmax_data_url && t.reachmax_data_url.length > 0 ? (this.url = t.reachmax_data_url, this.hasEX = !0) : this.url = t.url, t.mppt && (this.mppt = parseInt(t.mppt) || 0), t.is_need_video_info && (this.h5ad.is_need_video_info = t.is_need_video_info), "1" !== t.sg && void 0 !== t.sg && adTools.isMStation !== !1 || (this.renderCd = !0), t.duration && (this.duration = parseInt(t.duration)), this.pid = t.pid || 0, this.vid = t.vid || 0
        }, initEvent: function () {
            var e, t, a, i = H5AD.config.PROCESS_EVENT_TICKS;
            if (this.progressTicks = [], this.hasEX || this.hasMZ) {
                if (this.reqImpr = [], this.mppt) {
                    var s, r;
                    if (this.impression && this.impression.length > 0)for (t = 0; t < this.impression.length; t++)r = this.impression[t], s = {
                        event: "progress", cdata: r.cdata,
                        offset: this.mppt, type: "2" == r.type ? "2" : "1", isimpression: !0
                    }, this.progressTicks.push(parseFloat(this.mppt)), this.event.push(s)
                } else this.reqImpr = this.impression;
                this.reqResult = [], this.reqError = [], this.impression = []
            }
            if (this.event && this.event.length > 0)for (t = 0; t < this.event.length; t++) {
                if (e = this.event[t], this.hasEX || this.hasMZ) {
                    if ("reachs" == e.event) {
                        var s;
                        this.mppt ? (s = {
                                event: "progress",
                                cdata: e.cdata,
                                offset: this.mppt,
                                type: "4"
                            }, this.progressTicks.push(parseFloat(this.mppt))) : s = {
                                cdata: e.cdata,
                                event: "start",
                                type: "4"
                            }, this.event.push(s);
                        continue
                    }
                    if ("reachr" == e.event) {
                        this.reqResult.push(e.cdata);
                        continue
                    }
                    if (/^reach_err/.test(e.event)) {
                        this.reqError.push(e);
                        continue
                    }
                }
                if (void 0 != e.offset) this.progressTicks.push(parseFloat(e.offset)); else for (a = 0; a < i.length; a++)e.event == i[a].k && (this.event[t].event = "progress", this.event[t].offset = this.duration * i[a].v || 0, this.progressTicks.push(parseFloat(this.event[t].offset)))
            }
            this.h5ad.curAd = this
        }, sendEvent: function (e, t, a) {
            try {
                var i = this.getTrackArr(e, a);
                t.call(this.h5ad, 4, i, this)
            } catch (s) {
                adTools.debug("进度监测出错" + s.stack)
            }
        }, getTrackArr: function (e, t) {
            var a, i = [];
            if (this.event && this.event.length > 0)for (a = 0; a < this.event.length; a++)this.event[a].event == e && (void 0 != t ? t == this.event[a].offset && (this.mppt && this.event[a].isimpression ? i.push(this.event[a]) : i.push(this.event[a].cdata), this.event[a].event = "hadSent") : (this.mppt && this.event[a].isimpression ? i.push(this.event[a]) : i.push(this.event[a].cdata), this.event[a].event = "hadSent"));
            return i
        }, processMonitor: function () {
            var e = this, t = e.h5ad, a = H5AD.config.CALL_PLAYER_TYPE, i = 0, s = function () {
                return i = t.callback2Player(a.getRealTime) || 0, isNaN(i) && (i = 0), e.mppt && Math.abs(i - e.mppt) < 1 && t._sendArkTracking(1, {
                    curAD: e,
                    curIndex: e.curIdx
                }), i - t.lastPlayTime > 2 ? void t.callback2Player.call(t, a.seek, t.lastPlayTime) : void(t.lastPlayTime = i)
            };
            t.adEventDispatcher && (t.adEventDispatcher.off("OnTimeUpdate", s), t.adEventDispatcher.on("OnTimeUpdate", s))
        }, languageFit: function (e) {
            var t = e.toString(), a = this.h5ad.callback2Player(H5AD.config.CALL_PLAYER_TYPE.lanfit, t);
            return a
        }, renderRealCd: function (e, t, a) {
            var i, s, r, n, o, l = this, d = e, h = 0, c = Math, p = this.h5ad, u = adTools.el("#div_cdown" + l.h5ad.fid), g = e, f = p.putinVars.tplType, v = f && /^min|^simple/.test(f), m = v ? 12 : 24;
            if (l.processMonitor(), l.progressTicks.length > 0 ? (clearInterval(l.processTimer), l.processTimer = setInterval(function () {
                        o = p.callback2Player(H5AD.config.CALL_PLAYER_TYPE.getRealTime) || 0;
                        for (var e = 0; e < l.progressTicks.length; e++)if (c.abs(l.progressTicks[e] - o) <= 1 && (adTools.debug("进度监测：offset:" + l.progressTicks[e] + ",curTime:" + o + "," + e), l.sendEvent("progress", p._sendArkTracking, l.progressTicks[e]), l.progressTicks.splice(e, 1), --e, 0 == l.progressTicks.length)) {
                            clearInterval(l.processTimer);
                            break
                        }
                    }, 1e3)) : clearInterval(l.processTimer), adTools.canBeClicked || !adTools.iosNotPlayInline) {
                if (1 != l.renderCd)return void adTools.removeElem(adTools.el("#vdo_post_time" + l.h5ad.fid));
                for (i = l.curIdx; i >= 0; i--)g -= a[i];
                var _ = function (e, t, a) {
                    if ("-" == e)if (a instanceof Array) {
                        for (var i = 0, s = 0; s < a.length; s++)i += a[s];
                        e = i
                    } else e = "--";
                    var n = e;
                    for (r = n.toString().length, s = 0; s < l.curIdx; s++)n -= a[s];
                    return h = p.callback2Player(H5AD.config.CALL_PLAYER_TYPE.getRealTime) || 0, n -= c.ceil(h)
                };
                s = _.apply(this, arguments);
                var y = function (e) {
                    var t, a = e.toString(), i = "";
                    for (t = 0; t < r; t++)i += '<em id="cd' + p.fid + "_" + String(t) + '" class="precdImg" style="' + (a.length < 2 ? "float:right;" : "") + "background-image:url(" + H5AD.config.COUNTDOWN_IMG_URL + ");background-position:0 " + -parseInt(a.charAt(t)) * m + 'px;background-repeat: no-repeat;"></em>';
                    return i
                };
                if (adTools.existEl(u)) n = adTools.el("#div_cdown" + l.h5ad.fid); else {
                    n = lib.createElement("div", {className: "vdo_post_time", id: "vdo_post_time" + l.h5ad.fid});
                    var b = '<a href="javascript:;" id="vdo_skip_pre' + l.h5ad.fid + '"> ' + l.languageFit("跳过广告") + "</a>";
                    adTools.isMStation && (b = '<a href="javascript:void(0);">' + l.languageFit("广告") + "</a>"), n.innerHTML = ['<div class="vdo_post_rlt">', '<div class="vdo_time_bg"></div>', '<div class="vdo_time_info"><span id="div_cdown' + l.h5ad.fid + '"></span>' + b + "</div>", "</div>"].join(""), p.staticVars.countdownElem.appendChild(n), $js("#vdo_skip_pre" + l.h5ad.fid).on("click", function () {
                        l.skipAd()
                    }), $js("#div_cdown" + l.h5ad.fid)[0].innerHTML = y(s)
                }
                clearInterval(l.countdownTimer), l.countdownTimer = setInterval(function () {
                    var s = _(d, t, a);
                    if (s < 0)return void l.closeCountDown();
                    if (s < g)return void l.pauseCountDown();
                    var r = s.toString(), n = e.toString().length - r.length;
                    if (i = 0, n > 0)for (i = 0; i < n; i++)adTools.el("#cd" + p.fid + "_" + String(i)).style.backgroundPosition = "0 -" + (v ? 122 : 244) + "px";
                    for (j = r.length - 1; j >= 0; j--) {
                        var o = parseInt(r.charAt(j)) * m, h = adTools.el("#cd" + p.fid + "_" + String(j + i));
                        if (!adTools.existEl(h))return clearInterval(l.countdownTimer), clearInterval(l.processTimer), void clearInterval(l.monitorTimer);
                        h.style.backgroundPosition = "0 " + -o + "px"
                    }
                }, 500)
            }
        }, renderBigPlay: function (e) {
            if (adTools.canBeClicked || !adTools.iosNotPlayInline) {
                var t = this, a = this.h5ad, i = a.staticVars.countdownElem, s = adTools.el("#btn_a_resume" + a.fid);
                adTools.existEl(s) && adTools.removeElem(s), s = lib.createElement("div", {
                    id: "btn_a_resume" + a.fid,
                    className: "hv_ico_pasued"
                }), s.style.display = "block", i.appendChild(s), adTools.bind($js(s), function (i) {
                    i.stopPropagation(), i.cancelBubble = !0, t.closeBigPlay(e), a.callback2Player(H5AD.config.CALL_PLAYER_TYPE.resumeAD)
                })
            }
        }, seeDetail: function () {
            var e = this.h5ad;
            if (adTools.canBeClicked || !adTools.iosNotPlayInline) {
                var t = this, a = adTools.el("#a_see_detail" + e.fid), i = adTools.el("#a_see_more" + e.fid), s = e.staticVars.countdownElem, r = adTools.el(e.staticVars.countdownID + " .hv_ico_pasued"), n = "javascript:;";
                if (adTools.existEl(i)); else {
                    a = lib.createElement("a", {
                        target: "_blank",
                        href: n,
                        id: "a_see_detail" + e.fid,
                        className: "aps_mask_cont"
                    }), i = lib.createElement("div", {
                        className: "vdo_post_detail",
                        id: "vdo_post_detail" + e.fid
                    }), i.innerHTML = ['<div class="vdo_post_rlt">', ' <div class="vdo_detail_bg"></div>', '<div class="vdo_detail_info"><a id="a_see_more' + e.fid + '" href="' + n + '" target="_blank"><span style="float:left">' + t.languageFit("了解详情") + "</span><i></i></a></div>", "</div>"].join(""), adTools.existEl(r) ? (adTools.isUC || s.insertBefore(a, r), s.insertBefore(i, r)) : (adTools.isUC || s.appendChild(a), s.appendChild(i));
                    var o = function (a) {
                        a.stopPropagation(), a.cancelBubble = !0, e.dynamicVars.hasPlayed !== !1 && (n = e._getCtUrl(t, 2), e.callback2Player(H5AD.config.CALL_PLAYER_TYPE.pauseAD), e._sendUserLog(2, {
                            curAD: t,
                            curIndex: 0
                        }), e._sendArkTracking(2, {
                            curAD: t,
                            curIndex: 0
                        }), t.pid && t.vid ? t.openInApp(t.pid, t.vid) : window.open(n, "_blank"))
                    };
                    adTools.bind($js(a), o), adTools.bind($js(i), o)
                }
            }
        }, seeDSPIcon: function (e) {
            var t = this.h5ad;
            if (adTools.canBeClicked || !adTools.iosNotPlayInline) {
                var a = adTools.el("#vdo_dsp_icon" + t.fid), i = t.staticVars.countdownElem, s = adTools.el(t.staticVars.countdownID + " .hv_ico_pasued");
                e ? adTools.existEl(a) ? adTools.el("#img_dsp_icon" + this.h5ad.fid).setAttribute("src", e) : (a = lib.createElement("div", {
                            className: "vdo_dsp_icon",
                            id: "vdo_dsp_icon" + t.fid
                        }), a.style.cssText = "height:25px;position:absolute;z-index:13;left:2px;bottom:2px;", a.innerHTML = ['<img id="img_dsp_icon' + t.fid + '" src="' + e + '" height="25" width="25">'].join(""), adTools.existEl(s) ? i.insertBefore(a, s) : i.appendChild(a)) : adTools.existEl(a) && adTools.removeElem(a)
            }
        }, openInApp: function (e, t, a) {
            var i = "letvclient://msiteAction?actionType=0&pid=" + encodeURIComponent(e) + "&vid=" + encodeURIComponent(t) + "&from=mletv";
            if (br.Android) {
                var s = document.createElement("iframe");
                s.style.cssText = "width:0px;height:0px;position:fixed;top:0;left:0;", s.src = i, document.body.appendChild(s)
            } else location.href = i
        }, closeSeeDetail: function () {
            if (adTools.canBeClicked || !adTools.iosNotPlayInline) {
                var e = adTools.el("#a_see_detail" + this.h5ad.fid), t = adTools.el("#vdo_post_detail" + this.h5ad.fid);
                adTools.existEl(e) && adTools.removeElem(e), adTools.existEl(t) && adTools.removeElem(t)
            }
        }, closeSeeDSPIcon: function () {
            if (adTools.canBeClicked || !adTools.iosNotPlayInline) {
                var e = adTools.el("#vdo_dsp_icon" + this.h5ad.fid);
                adTools.existEl(e) && adTools.removeElem(e)
            }
        }, closeBigPlay: function (e) {
            if (adTools.canBeClicked || !adTools.iosNotPlayInline) {
                var t = this.h5ad, a = adTools.el("#btn_a_resume" + t.fid);
                adTools.existEl(a) && adTools.removeElem(a)
            }
        }, closeCountDown: function () {
            if (clearInterval(this.monitorTimer), adTools.canBeClicked || !adTools.iosNotPlayInline) {
                clearInterval(this.countdownTimer), clearInterval(this.processTimer);
                var e = adTools.el("#vdo_post_time" + this.h5ad.fid);
                adTools.existEl(e) && (this.pauseCountDown(), adTools.removeElem(e)), this.closeBigPlay(), this.closeSeeDetail(), this.closeSeeDSPIcon()
            }
        }, pauseCountDown: function () {
            clearInterval(this.monitorTimer), !adTools.canBeClicked && adTools.iosNotPlayInline || (clearInterval(this.countdownTimer), clearInterval(this.processTimer))
        }, skipAd: function () {
            var e, t = this.h5ad, a = H5AD.config, i = a.CALL_PLAYER_TYPE, s = t.callback2Player, r = t.staticVars.countdownElem;
            e = adTools.el("#aps_login" + t.fid), s.call(t, i.pauseAD), adTools.existEl(e) || (e = lib.createElement("div", {
                className: "aps_pop_poster",
                id: "aps_login" + t.fid
            }), e.innerHTML = ['<div class="hv_pop_poster">', '<p class="hv_p1">' + this.languageFit("如果您已是会员，请登录") + "</p>", '<p><a href="javascript:;" id="aps_login_button' + t.fid + '">' + this.languageFit("登录") + "</a></p>", '<a href="javascript:;" id="aps_login_close" class="close"><i></i><i class="i_1"></i></a></div>'].join(""), r.appendChild(e), t._sendData(a.SKIP_AD_CLICK), $js("#aps_login_button" + t.fid).on("click", function (e) {
                s(i.doLogin)
            }), $js("#aps_login_close").on("click", function (e) {
                s.call(t, i.resumeAD), adTools.removeElem(adTools.el("#aps_login" + t.fid))
            })), adTools.debug("点击跳过广告")
        }, loginAc: function (e) {
            var t = this.h5ad, a = H5AD.config, i = a.CALL_PLAYER_TYPE, s = t.callback2Player;
            e ? (s(i.stopAD, {reason: 9}), this.closeCountDown(), t._sendData(a.SKIP_AD_SUCC)) : s(i.resumeAD), adTools.debug("登录完成，返回level：" + e), adTools.removeElem($js(".aps_pop_poster")[0])
        }
    }, module.exports = H5AD
}


